$(function(){
    window.onload = function(){
        $.ajax({
            url: 'http://localhost:3000/guid/hot',
            type: 'get',
            success: function(res){
                // console.log(res[1]);
                var str = '';
                $.each(res,function(index,item){
                    console.log(item);
                    str += `
                    <li>
                    <img src=${item.img}>
                    <h5>${item.text}</h5>
                    <div class="box-1">
                        <span class="sp-7"><img src="../imgsmall/zan.png">${item.like} <img src="../imgsmall/reply.png">${item.words}</span>
                    </div>
                    </li>
                    `
                })
                $('.main-6-ul').html(str);
            }
          })
    }
    $('.main-1 span').eq(0).click(function(){
        window.location.href = "../guid/guidnew.html";
    })
    $('.main-1 span').eq(1).click(function(){
        window.location.href = "../guid/guidhot.html";
    })
    $('.main-1 span').eq(2).click(function(){
        window.location.href = "../guid/guiddetails.html";
    })
    $('.main-1 span').css('cursor','pointer');
   


})